<template>
    <div class="wrapper">
        <canvas width="500" height="500" ref="canvas"></canvas>
    </div>
</template>
<script>
    import Canvas from "./components/init";

    export default {
        mounted() {
            var canvas = this.$refs['canvas']
            canvas.style.background = "#eee"
            var stage = new Canvas.stage(canvas)
            var rect = new Canvas.rect({
                id: "rect1",
                width: 100, height: 100, fill: "#ff0000",
                isDragAble: true
            })
            rect.onClick = (x, y) => {
            }
            stage.add(rect)
        }
    }
</script>
<style lang="less" scoped>
    .wrapper {

    }
</style>